import React, { Component } from 'react'
import './App.css';
import { HashRouter } from 'react-router-dom'
import Header from './Components/Header'
import Sider from './Components/Sider'
import Footer from './Components/Footer'
import { Provider } from 'react-redux'
import store from './redux/store'
import IndexRouter from './router/IndexRouter';

export default class App extends Component {
  // 初始化静态文本片段
  state = {
    text_res: [
      { id: '001', text: '1', font_size: 15, font_color: 'black' },
      { id: '002', text: '2', font_size: 15, font_color: 'black' },
      { id: '003', text: '3', font_size: 15, font_color: 'black' }
    ]
  }
  render() {
    const { text_res } = this.state;
    return (
      <Provider store={store}>
        <HashRouter>
          <div className='box'>
            <Header />
            <div className='text-box'>
              <div className='main-box'>
                <IndexRouter/>
              </div>
              <Sider text_res={text_res} />
            </div>
            <Footer />
          </div>
        </HashRouter>
      </Provider>
    )
  }
}
